function [c,l,avgSC,avgSL]=calculateCandL(connectionM,th,iter,times)

thCM=threshold(connectionM,th);
[c,l]=graphMeasure(thCM);
[avgSC,avgSL]=surrogateNet(thCM,iter,times);

function [m]=threshold(m,th)
th_indx=m<th;
m(th_indx)=0;
